// 账单
import { DataListParams, DeleteParams } from './model'
import { defHttp } from '/@/utils/http/axios'
import { ErrorMessageMode } from '/@/utils/http/axios/types'

enum Api {
    listData = '/comments/list',
    deleteUrl = '/comments/delById',
}

/**
 * @description: 获取评论列表
 */
export function dataListApi(params: DataListParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request(
        {
            url: Api.listData,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}

/**
 * @description: 获取评论列表
 */
export function deleteApi(params: DeleteParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request(
        {
            url: Api.deleteUrl,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}
